package com.novel.entiy;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author tanghao
 * @date 2022/4/18
 */

/**
 * 用户表
 */
@ApiModel(value = "com-novel-entiy-TpUser")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tp_user")
public class TpUser {
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "")
    private Long id;

    /**
     * 昵称
     */
    @TableField(value = "nickname")
    @ApiModelProperty(value = "昵称")
    private String nickname;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    @ApiModelProperty(value = "邮箱")
    private String email;

    /**
     * 电话
     */
    @TableField(value = "phone")
    @ApiModelProperty(value = "电话")
    private String phone;

    /**
     * 用户名
     */
    @TableField(value = "username")
    @ApiModelProperty(value = "用户名")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "`password`")
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    @ApiModelProperty(value = "头像")
    private String avatar;

    /**
     * 是否签约  0 未签约 1 已签约 2签约中
     */
    @TableField(value = "is_sign")
    @ApiModelProperty(value = "是否签约")
    private Integer isSign;

    /**
     * 签约时间
     */
    @TableField(value = "sign_time")
    @ApiModelProperty(value = "签约时间")
    private Date signTime;

    /**
     * 0:普通用户 1:作者 2:编辑
     */
    @TableField(value = "`role`")
    @ApiModelProperty(value = "0:普通用户 1:作者 2:编辑")
    private Integer role;

    /**
     * 金币数
     */
    @TableField(value = "gold_coin_nums")
    @ApiModelProperty(value = "金币数")
    private Long goldCoinNums;

    /**
     * 小说数
     */
    @TableField(value = "novel_nums")
    @ApiModelProperty(value = "小说数")
    private Long novelNums;

    /**
     * 打赏金额总数
     */
    @TableField(value = "reward_amount")
    @ApiModelProperty(value = "打赏金额总数")
    private Long rewardAmount;

    /**
     * 小说总字数
     */
    @TableField(value = "novel_words_nums")
    @ApiModelProperty(value = "小说总字数")
    private Long novelWordsNums;

    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "")
    private Date createdTime;

    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "")
    private Date updatedTime;

    @TableLogic
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "")
    private Integer deleted;

    public static final String COL_ID = "id";

    public static final String COL_NICKNAME = "nickname";

    public static final String COL_EMAIL = "email";

    public static final String COL_PHONE = "phone";

    public static final String COL_USERNAME = "username";

    public static final String COL_PASSWORD = "password";

    public static final String COL_AVATAR = "avatar";

    public static final String COL_IS_SIGN = "is_sign";

    public static final String COL_SIGN_TIME = "sign_time";

    public static final String COL_ROLE = "role";

    public static final String COL_GOLD_COIN_NUMS = "gold_coin_nums";

    public static final String COL_NOVEL_NUMS = "novel_nums";

    public static final String COL_REWARD_AMOUNT = "reward_amount";

    public static final String COL_NOVEL_WORDS_NUMS = "novel_words_nums";

    public static final String COL_CREATED_TIME = "created_time";

    public static final String COL_UPDATED_TIME = "updated_time";

    public static final String COL_DELETED = "deleted";
}